<?php
// +----------------------------------------------------------------------
// | ThinkPHP [ WE CAN DO IT JUST THINK ]
// +----------------------------------------------------------------------
// | Copyright (c) 2006~2018 http://thinkphp.cn All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: liu21st <liu21st@gmail.com>
// +----------------------------------------------------------------------
use think\facade\Route;

/**
 * 用户模块 相关路由
 */
Route::group('platform', function () {
    /**************************************微信公众平台******************************************************/

    Route::group('wechat', function () {

        Route::resource("index", 'v1.platform.wechat.Wechat');
        Route::rule('index/:action', 'v1.platform.wechat.Wechat/:action');
        //用户
        Route::resource('user', 'v1.platform.wechat.WechatUser');
        //退款
        Route::resource('refund', 'v1.platform.wechat.WechatRefund');
        //付款
        Route::resource('transfer', 'v1.platform.wechat.WechatTransfer');
        //订单
        Route::resource('order', 'v1.platform.wechat.WechatOrder');
        //分账
        Route::resource('share', 'v1.platform.wechat.WechatShare');
        Route::rule('share/:action', 'v1.platform.wechat.WechatShare/:action');

        //分账账户
        Route::resource('share_receiver', 'v1.platform.wechat.WechatShareReceiver');
        //应用
        Route::rule('addon/:action', 'v1.platform.wechat.WechatAddon/:action');
        //设置
        Route::rule('setting/:name', 'v1.platform.wechat.WechatSetting/:name');
    });
    // 小程序平台
    Route::group('min_app', function () {
        Route::resource("index", 'v1.platform.app.MinApp');
        // 小程序通用
        Route::rule('index/:action', 'v1.platform.app.MinApp/:action');
        // 小程序设置
        Route::rule('setting/:action', 'v1.platform.app.MinAppSetting/:action');
        // 小程序上传
        Route::rule('upload/:action', 'v1.platform.app.MinAppUpload/:action');
        // 服务商
        Route::rule('open/:action', 'v1.platform.app.MinAppOpen/:action');
        // 抖音服务商
        Route::rule('douyin_open/:action', 'v1.platform.app.MinAppDouyinOpen/:action');

    });
    // 自由平台
    Route::group('free', function () {

        Route::resource("index", 'v1.platform.free.free');
        Route::rule('index/:action', 'v1.platform.free.free/:action');
        //设置
        Route::rule('setting/:name', 'v1.platform.free.FreeSetting/:name');
    });
    // 企业微信平台
    Route::group('work_wechat', function () {

        Route::resource("index", 'v1.platform.work_wechat.WorkWechat');
        Route::rule('index/:action', 'v1.platform.work_wechat.WorkWechat/:action');
        Route::rule('addon/:action', 'v1.platform.work_wechat.WorkWechatAddon/:action');
        Route::rule('apps/:action', 'v1.platform.work_wechat.WorkWechatApps/:action');
        Route::rule('kf/msg/:action', 'v1.platform.work_wechat.WorkWechatKfMsg/:action');
        Route::rule('kf/user/:action', 'v1.platform.work_wechat.WorkWechatKfUser/:action');
        Route::rule('kf/servicer/:action', 'v1.platform.work_wechat.WorkWechatKfServicer/:action');
        //设置
        Route::rule('setting/:name', 'v1.platform.work_wechat.WorkWechatSetting/:name');
    });
    // 抖音平台
    Route::group('douyin', function () {

        Route::resource("index", 'v1.platform.douyin.Douyin');
        Route::rule('index/:action', 'v1.platform.douyin.Douyin/:action');
        Route::rule('addon/:action', 'v1.platform.douyin.DouyinAddon/:action');
        //设置
        Route::rule('setting/:name', 'v1.platform.douyin.DouyinSetting/:name');
    });
    Route::resource("index", 'v1.platform.index');

    // 通用平台
    Route::rule('addon/:action', 'v1.platform.PlatformAddon/:action');

    // 小程序平台
    Route::rule('app/:action','v1.platform.PlatformApp/:action');
    // 小程序用户次数
    Route::rule('app_user/:action','v1.platform.PlatformAppUser/:action');

    //修改状态
    Route::post('status', 'v1.platform.index/status');
    //删除平台
    Route::post('delete', 'v1.platform.index/delete');
    //清除平台
    Route::post('destroy', 'v1.platform.index/destroy');
    //恢复平台
    Route::post('recovery', 'v1.platform.index/recovery');

    Route::rule('editUserForm', 'v1.platform.index/editUserForm');
    Route::rule('saveUser', 'v1.platform.index/saveUser');
});
